<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct unsafe_access</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Histogram">
<link rel="up" href="../../histogram/reference.html#header.boost.histogram.unsafe_access_hpp" title="Header &lt;boost/histogram/unsafe_access.hpp&gt;">
<link rel="prev" href="unlimited_storage.html" title="Class template unlimited_storage">
<link rel="next" href="weight.html" title="Function template weight">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="unlimited_storage.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../histogram/reference.html#header.boost.histogram.unsafe_access_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="weight.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.histogram.unsafe_access"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct unsafe_access</span></h2>
<p>boost::histogram::unsafe_access — Unsafe read/write access to private data that potentially breaks consistency. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../histogram/reference.html#header.boost.histogram.unsafe_access_hpp" title="Header &lt;boost/histogram/unsafe_access.hpp&gt;">boost/histogram/unsafe_access.hpp</a>&gt;

</span>
<span class="keyword">struct</span> <a class="link" href="unsafe_access.html" title="Struct unsafe_access">unsafe_access</a> <span class="special">{</span>

  <span class="comment">// <a class="link" href="unsafe_access.html#idm45537378759488-bb">public static functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a class="link" href="unsafe_access.html#idm45537378758928-bb"><span class="identifier">axes</span></a><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a class="link" href="unsafe_access.html#idm45537378755472-bb"><span class="identifier">axes</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">,</span> <span class="keyword">unsigned</span> I <span class="special">=</span> <span class="number">0</span><span class="special">&gt;</span> 
    <span class="keyword">static</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> 
    <a class="link" href="unsafe_access.html#idm45537378752016-bb"><span class="identifier">axis</span></a><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">I</span> <span class="special">&gt;</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> 
    <span class="keyword">static</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a class="link" href="unsafe_access.html#idm45537378746128-bb"><span class="identifier">axis</span></a><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a class="link" href="unsafe_access.html#idm45537378741536-bb"><span class="identifier">storage</span></a><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a class="link" href="unsafe_access.html#idm45537378738080-bb"><span class="identifier">storage</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a class="link" href="unsafe_access.html#idm45537378734624-bb"><span class="identifier">offset</span></a><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a class="link" href="unsafe_access.html#idm45537378731168-bb"><span class="identifier">offset</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Allocator<span class="special">&gt;</span> 
    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <span class="special">&amp;</span> 
    <a class="link" href="unsafe_access.html#idm45537378727712-bb"><span class="identifier">unlimited_storage_buffer</span></a><span class="special">(</span><a class="link" href="unlimited_storage.html" title="Class template unlimited_storage">unlimited_storage</a><span class="special">&lt;</span> <span class="identifier">Allocator</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a class="link" href="unsafe_access.html#idm45537378722480-bb"><span class="identifier">storage_adaptor_impl</span></a><span class="special">(</span><a class="link" href="storage_adaptor.html" title="Class template storage_adaptor">storage_adaptor</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm46096941351792"></a><h2>Description</h2>
<p>This struct enables access to private data of some classes. It is intended for library developers who need this to implement algorithms efficiently, for example, serialization. Users should not use this. If you are a user who absolutely needs this to get a specific effect, please submit an issue on Github. Perhaps the public interface is insufficient and should be extended for your use case.</p>
<p>Unlike the normal interface, the <a class="link" href="unsafe_access.html" title="Struct unsafe_access">unsafe_access</a> interface may change between versions. If your code relies on<a class="link" href="unsafe_access.html" title="Struct unsafe_access">unsafe_access</a>, it may or may not break when you update Boost. This is another reason to not use it unless you are ok with these conditions.</p>
<div class="refsect2">
<a name="idm46096941348512"></a><h3>
<a name="idm45537378759488-bb"></a><code class="computeroutput">unsafe_access</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a name="idm45537378758928-bb"></a><span class="identifier">axes</span><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">)</span><span class="special">;</span></pre>Get axes. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a name="idm45537378755472-bb"></a><span class="identifier">axes</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">)</span><span class="special">;</span></pre>Get axes. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">,</span> <span class="keyword">unsigned</span> I <span class="special">=</span> <span class="number">0</span><span class="special">&gt;</span> 
  <span class="keyword">static</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> 
  <a name="idm45537378752016-bb"></a><span class="identifier">axis</span><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="identifier">I</span> <span class="special">&gt;</span> <span class="special">=</span> <span class="special">{</span><span class="special">}</span><span class="special">)</span><span class="special">;</span></pre>Get mutable axis reference with compile-time number. <p>

</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Template Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">I</code></span></p></td>
<td><p>axis index (optional, default: 0). </p></td>
</tr></tbody>
</table></div></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> 
  <span class="keyword">static</span> <span class="keyword">decltype</span><span class="special">(</span><span class="keyword">auto</span><span class="special">)</span> <a name="idm45537378746128-bb"></a><span class="identifier">axis</span><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">,</span> <span class="keyword">unsigned</span> i<span class="special">)</span><span class="special">;</span></pre>Get mutable axis reference with run-time number. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">i</code></span></p></td>
<td><p>axis index. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a name="idm45537378741536-bb"></a><span class="identifier">storage</span><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">)</span><span class="special">;</span></pre>Get storage. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> 
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a name="idm45537378738080-bb"></a><span class="identifier">storage</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">)</span><span class="special">;</span></pre>Get storage. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> <span class="keyword">static</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a name="idm45537378734624-bb"></a><span class="identifier">offset</span><span class="special">(</span><span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">)</span><span class="special">;</span></pre>Get index offset. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Histogram<span class="special">&gt;</span> 
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a name="idm45537378731168-bb"></a><span class="identifier">offset</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Histogram</span> <span class="special">&amp;</span> hist<span class="special">)</span><span class="special">;</span></pre>Get index offset. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">hist</code></span></p></td>
<td><p>histogram </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Allocator<span class="special">&gt;</span> 
  <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <span class="special">&amp;</span> 
  <a name="idm45537378727712-bb"></a><span class="identifier">unlimited_storage_buffer</span><span class="special">(</span><a class="link" href="unlimited_storage.html" title="Class template unlimited_storage">unlimited_storage</a><span class="special">&lt;</span> <span class="identifier">Allocator</span> <span class="special">&gt;</span> <span class="special">&amp;</span> storage<span class="special">)</span><span class="special">;</span></pre>Get buffer of <code class="computeroutput"><a class="link" href="unlimited_storage.html" title="Class template unlimited_storage">unlimited_storage</a></code>.<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">storage</code></span></p></td>
<td><p>instance of <code class="computeroutput"><a class="link" href="unlimited_storage.html" title="Class template unlimited_storage">unlimited_storage</a></code>.</p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
  <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <span class="special">&amp;</span> <a name="idm45537378722480-bb"></a><span class="identifier">storage_adaptor_impl</span><span class="special">(</span><a class="link" href="storage_adaptor.html" title="Class template storage_adaptor">storage_adaptor</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;</span> storage<span class="special">)</span><span class="special">;</span></pre>Get implementation of <code class="computeroutput"><a class="link" href="storage_adaptor.html" title="Class template storage_adaptor">storage_adaptor</a></code>.<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">storage</code></span></p></td>
<td><p>instance of <code class="computeroutput"><a class="link" href="storage_adaptor.html" title="Class template storage_adaptor">storage_adaptor</a></code>.</p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Hans
      Dembinski<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="unlimited_storage.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../histogram/reference.html#header.boost.histogram.unsafe_access_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="weight.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
